package com.chenxi.vhr.bean.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Collection;

/**
 * 分页对象
 * @author : zhangchenxi
 * @create : 2022-02-10
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultPageInfo<E> {

    private Integer status;

    private long total;

    private Object obj;

    public static ResultPageInfo genPageInfo(Collection collection, Integer total) {
        ResultPageInfo info = new ResultPageInfo();
        info.setStatus(200);
        info.setObj(collection);
        info.setTotal(total);
        return info;
    }

}
